function rate=massFunction(mass)
% massfunction for log
%hurley 2008
global  AllmassNUM M1MAX M1MIN SFR qNUM aNUM alpha

if(mass>1)
    rate=(mass/M1MIN).^(1-alpha).*SFR.*(log(M1MAX)-log(M1MIN))...
        ./AllmassNUM./qNUM./aNUM.*1d6 .* (alpha-1);
% rate=exp(-0.3.*mass);
else
    rate=NaN;
end

end